﻿<?php
include ("tier1.php");


function register_game($title,$release_date,$category)
{
	if(($title!="")&&($category!=""))
	{
		ob_start();
		echo $title;
		$len = ob_get_length();
		ob_end_clean();
		if($len<20)
		{
			$boolean=check_game_exist($title);
			if ($boolean == false)
			{
				$category_id=get_game_category_id($category);
				insert_into_game($title,$release_date,$category_id);
				return 1; //to paixnidi exei kataxorithei!!!
			}
			else
			{
				return 2; //to paixnidi einai idi kataxorimeno
			}
		}
		else 
			return 3; //polu megalo onoma
	}
	else
	{
		return 4;  //den exei ginei eisagogi tou titlou i tis katigorias tou paixnidiou
	}
	
}
?>